const Index = {
	// 下拉刷新
	async refresh(_this, name){
        name = name || 'refresh'
        wx.showNavigationBarLoading()
		if( name === 'paging' ){
            await _this?.[name]?.({ refresh:true })
        }else{
            await _this?.[name]?.()
        }
		wx.stopPullDownRefresh({
			success: res => {
                wx.hideNavigationBarLoading()
				this.msg.info('刷新成功')
			},
		})
    },
    async refresh_paging(_this){
        await this.refresh(_this,'paging')
    },
	// 关闭自定义下拉刷新
	refresh_close(_this, cpt){
		_this.selectComponent?.(cpt || '#page')?.close?.()
    },
     // 开始下拉刷新
    refresh_start(){
        wx.startPullDownRefresh()       
    }
}

export default Index